package edu.jd.authoritymanagement;

import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AuthorityDao {

    @Select("select * from authority")
    public List<Authority> getAuthorities();

    @Select("select * from role_auth where role_id = #{role_id}")
    public List<Authority> getAuthoritiesByRoleId(Integer role_id);

    @Select("select distinct role_id from role_auth where auth_id = #{auth_id}")
    public List<Integer> getRoleByAuthId(Integer auth_id);
}
